/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wisimconsole;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
/**
 *
 * @author brother
 */
public class Test2 extends JFrame {
  JSlider js1 = new JSlider(), js2 = new JSlider();
  Random r = new Random();
  public Test2() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    content.setLayout(new GridBagLayout());
    js1.setOpaque(false);
    js2.setOpaque(false);
    js1.setMajorTickSpacing(33);
    js2.setMajorTickSpacing(20);
    js1.setPaintTicks(true);
    js2.setPaintTicks(true);
    GridBagConstraints gbc = new GridBagConstraints(0,0,1,1,1.0,0.0,
                                           GridBagConstraints.CENTER,
                                           GridBagConstraints.HORIZONTAL,
                                           new Insets(0,0,0,0),0,0);
 
    content.add(js1, gbc);
    content.add(js2, gbc);
    gbc.gridy++;
    gbc.weightx=0.0;
    gbc.fill=GridBagConstraints.NONE;
    JButton jb = new JButton("Random");
    content.add(jb, gbc);
    jb.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        js1.setValue(r.nextInt(100));
        js2.setValue(r.nextInt(100));
      }
    });
    setSize(300,300);
  }
  public static void main(String[] args) { new Test2().setVisible(true); }
}